<template>
  <div>
    <el-card shadow="always" class="box-card">
      <div class="tableTitle"><span>基本信息</span></div>
      <div class="devTitle"><span>{{detailInfo.deviceName}}</span></div>
      <div>
        <div class="tableStyle">
          <div class="labelS">记录编号</div>
          <div class="contentS">{{detailInfo.recordNum}}</div>
        </div>
        <div class="tableStyle">
          <div class="labelS">设备编号</div>
          <div class="contentS">{{detailInfo.deviceNum}}</div>
          <!-- <div class="contentS">140</div>
          <div class="contentS">410</div> -->
        </div>
        <div class="tableStyle">
          <div class="labelS">位置</div>
          <div class="contentS">{{detailInfo.location}}</div>
        </div>
        <div class="tableStyle">
          <div class="labelS">点检人</div>
          <div class="contentS">{{detailInfo.inspector}}</div>
           <div class="labelS">点检时间</div>
            <div class="contentS">{{detailInfo.inspectionTime}}</div>
        </div>
        <div class="tableStyle">
          <div class="labelS">要求</div>
          <div class="contentS">
            {{detailInfo.remark}}
          </div>
        </div>
        <!-- <div class="tableStyle">
          <div class="labelS">点检图片</div>
          <div class="contentS">
            {{detailInfo.remark}}
          </div>
        </div> -->
      </div>
    </el-card>
    <el-card shadow="always" class="box-card">
      <div class="tableTitle"><span>点检信息</span></div>
       <el-card shadow="always" class="box-card" style="box-shadow:0px 0px 7px 0px #eff2f5">
           <el-row>
               <el-col :span="6">
                    <div>点检项目个数</div>
                    <div class="number">{{detailInfo.itemCount}}</div>
               </el-col>
                <el-col :span="6">
                    <div>已检数</div>
                    <div class="number" style="color:#54B03A">{{detailInfo.checkedCount}}</div>
               </el-col>
                <el-col :span="6">
                    <div>异常项目</div>
                    <div class="number" style="color:#FF5722">{{detailInfo.abnormalQuantity}}</div>
               </el-col>
                <el-col :span="6">
                    <div>执行说明</div>
                    <div class="number"></div>
               </el-col>
           </el-row>
       </el-card>
    </el-card>
    <el-card shadow="always" class="box-card">
      <div class="tableTitle"><span>点检结果表</span></div>
      <el-table :data="tableData" border style="width: 100%">
        <el-table-column prop="itemsName" label="项目"> </el-table-column>
        <el-table-column prop="inspectVal" label="点检值"> </el-table-column>
        <el-table-column prop="inspectionTime" label="点检时间"> </el-table-column>
        <el-table-column prop="abnormal" label="是否异常"  > </el-table-column>
        <el-table-column prop="high" label="点检图片"> </el-table-column>
        <el-table-column prop="clearAbnormal" label="消除异常项"> </el-table-column>
        <el-table-column prop="solution" label="处理措施"> </el-table-column>
        <el-table-column prop="remark" label="备注"> </el-table-column>
      </el-table>
      <div style="text-align:right;margin-top:20px;">
                <el-pagination
  background
  :pager-count="5"
  layout="total,prev, pager, next"

 :page-size="pageSize"
 @current-change="handleCurrentChange"
 :current-page.sync="currentPage"
  :total="total">
</el-pagination>
            </div>
    </el-card>
  </div>
</template>
<script>
import {getObj,resultList} from "@/api/ems/inspection/report";
export default {
  data() {
    return {
      tableData: [],
      recordId:'',
      detailInfo:{},
       total: 0, // 总页数
        currentPage: 1, // 当前页数
        pageSize: 20, // 每页显示多少条
    };
  },
  mounted(){
    this.recordId = this.$route.query.id;
    this.getObj();
  },
  methods:{
getObj(){
    getObj(this.recordId).then((res)=>{
      this.detailInfo = res.data.data;
      this.resultList();
    })
  },
  resultList(){
        resultList({recordId:this.detailInfo.id,size:this.pageSize,current:this.currentPage}).then((res)=>{
            this.tableData=res.data.data.records;
            this.total = res.data.data.total;
        })
    },
    handleCurrentChange(index){
        this.currentPage = index;
        this.resultList();
    },
  }
  
};
</script>
<style lang="scss" scoped>
.tableTitle {
  color: #333;
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 20px;
}
.devTitle {
  color: #262626;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
}
.box-card {
  margin-bottom: 10px;
  .el-card__body {
    padding-top: 10px;
  }
  .labelS {
    //display: inline-block;
    flex:0 0 150px;
    //height: 40px;
    // margin-right: 10px;
    text-align: left;
    color: #606266;
    padding: 10px;
    border: 1px solid rgba(236, 240, 244, 100);
    margin-bottom: -1px;
  }
  .contentS {
    border: 1px solid rgba(236, 240, 244, 100);
    // height: 40px;
    color: #606266;
    width: 100%;
    margin-left: -1px;
    margin-bottom: -1px;
    padding: 10px;
    // margin: 10px 0;
    // width: calc(100% - 120px);
    // display: inline-block;
  }
  .tableStyle {
    display: flex;
  }
  .number{
      font-weight: bold;
      margin-top: 5px;
      font-size: 16px;
  }
}
</style>
